{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenAPI definition",
    "version": "v0"
  },
  "servers": [
    {
      "url": "http://localhost:8080/api/v1",
      "description": "Generated server url"
    }
  ],
  "tags": [
    {
      "name": "User profile Api",
      "description": "User profile management"
    },
    {
      "name": "Actuator",
      "description": "Monitor and interact",
      "externalDocs": {
        "description": "Spring Boot Actuator Web API Documentation",
        "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/"
      }
    }
  ],
  "paths": {
    "/users/{userId}/details/{id}": {
      "get": {
        "tags": [
          "User profile Api"
        ],
        "summary": "Get user details by Id",
        "operationId": "getUserDetails",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Schema not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/UserDetailsDto"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "User profile Api"
        ],
        "summary": "Update user details by Id",
        "operationId": "updateUserDetails",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserDetailsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Missing or invalid request body",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "User details not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "200": {
            "description": "Successfully updated user details",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/UserDetailsDto"
                }
              }
            }
          }
        }
      }
    },
    "/users/{id}": {
      "get": {
        "tags": [
          "User profile Api"
        ],
        "summary": "Get user by Id",
        "operationId": "getUserWithDetails",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Schema not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "User profile Api"
        ],
        "summary": "Update user by Id",
        "operationId": "updateUser",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Missing or invalid request body",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "User not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "200": {
            "description": "Successfully updated user",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              }
            }
          }
        }
      }
    },
    "/users": {
      "post": {
        "tags": [
          "User profile Api"
        ],
        "summary": "Create user",
        "operationId": "createUser",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Missing or invalid request body",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "201": {
            "description": "Successfully created user",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              }
            }
          }
        }
      }
    },
    "/actuator/mappings": {
      "get": {
        "tags": [
          "Actuator"
        ],
        "summary": "Actuator web endpoint 'mappings'",
        "operationId": "mappings",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/vnd.spring-boot.actuator.v3+json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingResponse"
                }
              },
              "application/vnd.spring-boot.actuator.v2+json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingResponse"
                }
              }
            }
          }
        }
      }
    },
    "/actuator/liquibase": {
      "get": {
        "tags": [
          "Actuator"
        ],
        "summary": "Actuator web endpoint 'liquibase'",
        "operationId": "liquibase",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/vnd.spring-boot.actuator.v3+json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/vnd.spring-boot.actuator.v2+json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/actuator/health/{*path}": {
      "get": {
        "tags": [
          "Actuator"
        ],
        "summary": "Actuator web endpoint 'health-path'",
        "operationId": "health-path",
        "parameters": [
          {
            "name": "*path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/vnd.spring-boot.actuator.v3+json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/vnd.spring-boot.actuator.v2+json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/actuator/health": {
      "get": {
        "tags": [
          "Actuator"
        ],
        "summary": "Actuator web endpoint 'health'",
        "operationId": "health",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/vnd.spring-boot.actuator.v3+json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              },
              "application/vnd.spring-boot.actuator.v2+json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "LocalTime": {
        "type": "object",
        "properties": {
          "hour": {
            "type": "integer",
            "format": "int32"
          },
          "minute": {
            "type": "integer",
            "format": "int32"
          },
          "second": {
            "type": "integer",
            "format": "int32"
          },
          "nano": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "UserDetailsDto": {
        "required": [
          "telegramId",
          "zoneId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "telegramId": {
            "pattern": "(?:@|(?:(?:(?:https?://)?t(?:elegram)?)\\.me\\/))(\\w{4,})$",
            "type": "string"
          },
          "mobilePhone": {
            "pattern": "^(\\+\\d{1,3}( )?)?((\\(\\d{3}\\))|\\d{3})[- .]?\\d{3}[- .]?\\d{4}$|^(\\+\\d{1,3}( )?)?(\\d{3}[ ]?){2}\\d{3}$|^(\\+\\d{1,3}( )?)?(\\d{3}[ ]?)(\\d{2}[ ]?){2}\\d{2}$",
            "type": "string"
          },
          "zoneId": {
            "type": "string"
          }
        },
        "description": "Information about user details"
      },
      "UserDto": {
        "required": [
          "email",
          "firstName",
          "lastName",
          "userDetails"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "firstName": {
            "maxLength": 30,
            "minLength": 0,
            "type": "string"
          },
          "lastName": {
            "maxLength": 30,
            "minLength": 0,
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "userDetails": {
            "$ref": "#/components/schemas/UserDetailsDto"
          }
        },
        "description": "Information about user"
      },
      "HealthResponse": {
        "type": "object",
        "properties": {
          "components": {
            "type": "components"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "Components": {
        "properties": {
          "diskSpace": {
            "type": "discSpace"
          },
          "ping": {
            "type": "ping"
          },
          "db": {
            "type": "db"
          }
        }
      },
      "discSpace": {
        "properties": {
          "diskSpaceDetails": {
            "type": "diskSpaceDetails"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "diskSpaceDetails": {
        "type": "object",
        "properties": {
          "database": {
            "type": "string"
          },
          "validationQuery": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "total": {
            "type": "integer",
            "format": "int64"
          },
          "exists": {
            "type": "boolean"
          },
          "threshold": {
            "type": "integer",
            "format": "int32"
          },
          "free": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ping": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "db": {
        "type": "object",
        "properties": {
          "database": {
            "type": "string"
          },
          "validationQuery": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "total": {
            "type": "integer",
            "format": "int64"
          },
          "exists": {
            "type": "boolean"
          },
          "threshold": {
            "type": "integer",
            "format": "int32"
          },
          "free": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "MappingResponse": {
        "type": "object",
        "properties": {
          "contexts": {
            "type": "contexts"
          }
        }
      },
      "contexts": {
        "type": "object",
        "properties": {
          "application": {
            "type": "application"
          }
        }
      },
      "application": {
        "type": "object",
        "properties": {
          "mappings": {
            "type": "mappings"
          }
        }
      },
      "mappings": {
        "type": "object",
        "properties": {
          "dispatcherHandlers": {
            "type": "dispatcherHandlers"
          }
        }
      },
      "dispatcherHandlers": {
        "type": "object",
        "properties": {
          "webHandler": {
            "type": "array",
            "items": {
              "type": "webHandler"
            }
          }
        }
      },
      "webHandler": {
        "type": "object",
        "properties": {
          "predicate": {
            "type": "string"
          },
          "handler": {
            "type": "string"
          },
          "details": {
            "type": "details"
          }
        }
      },
      "details": {
        "type": "object",
        "properties": {
          "handlerMethod": {
            "type": "handlerMethod"
          },
          "requestMappingConditions": {
            "type": "requestMappingConditions"
          }
        }
      },
      "handlerMethod": {
        "type": "object",
        "properties": {
          "className": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "descriptor": {
            "type": "string"
          }
        }
      },
      "requestMappingConditions": {
        "type": "object",
        "properties": {
          "headers": {
            "items": {
              "type": "string"
            }
          },
          "methods": {
            "items": {
              "type": "string"
            }
          },
          "patterns": {
            "items": {
              "type": "string"
            }
          },
          "produces": {
            "items": {
              "type": "produce"
            }
          },
          "params": {
            "items": {
              "type": "object"
            }
          },
          "consumes": {
            "items": {
              "type": "object"
            }
          }
        }
      },
      "produce": {
        "type": "object",
        "properties": {
          "negated": {
            "type": "boolean"
          },
          "mediaType": {
            "type": "string"
          }
        }
      }
    }
  }
}
